//
//  Notice.swift
//  JTYP
//
//  Created by Groot on 2017/12/6.
//  Copyright © 2017年 inspur. All rights reserved.
//
import ObjectMapper

enum NoticeType: Int {
    case nomal = 1
    case edit = 2
    case health = 3
    case message = 4
}

enum NoticeRollType: Int {
    case nomal = 2
    case roll = 1
}

class Attaches: Mappable {
    var code: String?
    var creater: Int?
    var createtime: String?
    var id: Int?
    var name: String?
    var status: Int?
    var url: String?
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        code         <- map["code"]
        creater      <- map["creater"]
        createtime   <- map["createtime"]
        id           <- map["id"]
        name         <- map["name"]
        status       <- map["status"]
        url          <- map["url"]
    }
}

class Picture: Mappable {
    var code: String?
    var creater: Int?
    var createtime: String?
    var id: Int?
    var name: String?
    var status: Int?
    var url: String?
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        code         <- map["code"]
        creater      <- map["creater"]
        createtime   <- map["createtime"]
        id           <- map["id"]
        name         <- map["name"]
        status       <- map["status"]
        url          <- map["url"]
    }
}

class Vote: Mappable {
    var id: Int?
    var photo: Int?
    var photourl: String?
    var status: Int?
    var statusname: String?
    var type: Int?
    var typename: String?
    var userid: Int?
    var username: String?
    var votedid: Int?
    var votetime: String?
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        id            <- map["id"]
        photo         <- map["photo"]
        photourl      <- map["photourl"]
        status        <- map["status"]
        statusname    <- map["statusname"]
        type          <- map["type"]
        typename      <- map["typename"]
        userid        <- map["userid"]
        username      <- map["username"]
        votedid       <- map["votedid"]
        votetime      <- map["votetime"]
    }
}

class Notice: Mappable {
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        approveopinion   <- map["approveopinion"]
        approver         <- map["approver"]
        approvetime      <- map["approvetime"]
        attach           <- map["attach"]
        attaches         <- map["attaches"]
        changer          <- map["changer"]
        changername      <- map["changername"]
        changetime       <- map["changetime"]
        content          <- map["content"]
        creater          <- map["creater"]
        creatername      <- map["creatername"]
        createrphoto     <- map["createrphoto"]
        createrphotourl  <- map["createrphotourl"]
        createtime       <- map["createtime"]
        global           <- map["global"]
        globalname       <- map["globalname"]
        id               <- map["id"]
        pic              <- map["pic"]
        picture          <- map["picture"]
        pictures         <- map["pictures"]
        publishdept      <- map["publishdept"]
        publishdeptname  <- map["publishdeptname"]
        publishtime      <- map["publishtime"]
        pv               <- map["pv"]
        roll             <- map["roll"]
        rollname         <- map["rollname"]
        star             <- map["star"]
        status           <- map["status"]
        subtype          <- map["subtype"]
        subtypename      <- map["subtypename"]
        title            <- map["title"]
        type             <- map["type"]
        typename         <- map["typename"]
        version          <- map["version"]
        votes            <- map["votes"]
    }
    
    var approveopinion: String?
    var approver: Int?
    var approvetime: String?
    var attach: String?
    var attaches: [Attaches]?
    var changer: Int?
    var changername: String?
    var changetime: String?
    var content: String?
    var creater: Int?
    var creatername: String?
    var createrphoto: Int?
    var createrphotourl: String?
    var createtime: String?
    var global: Int?
    var globalname: String?
    var id: Int?
    var pic: Int?
    var picture: String?
    var pictures: [Picture]?
    var publishdept: Int?
    var publishdeptname: String?
    var publishtime: String?
    var pv: Int?
    var roll: String?
    var rollname: String?
    var star: Int?
    var status: String?
    var subtype: Int?
    var subtypename: String?
    var title: String?
    var type: String?
    var typename: String?
    var version: Int?
    var votes: [Vote]?
}

